```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>二维数组详解 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d3748;
            border-radius: 0.5rem;
            position: relative;
        }
        .code-block pre {
            margin: 0;
            padding: 1.5rem;
            overflow-x: auto;
        }
        .copy-btn {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            color: #a0aec0;
            cursor: pointer;
            transition: all 0.2s;
        }
        .copy-btn:hover {
            color: #ffffff;
        }
        .concept-card {
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .concept-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .exercise {
            border-left: 4px solid #4f46e5;
            transition: all 0.3s;
        }
        .exercise:hover {
            background-color: #f8fafc;
        }
        .footer {
            background-color: #1a202c;
        }
        .array-visualization {
            display: grid;
            gap: 2px;
        }
        .array-cell {
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #e2e8f0;
            padding: 1rem;
            font-weight: 500;
            background-color: #f7fafc;
            transition: all 0.2s;
        }
        .array-cell:hover {
            background-color: #ebf8ff;
            transform: scale(1.05);
        }
        .highlight {
            background-color: #c6f6d5;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-4 animate-fade-in">二维数组解析</h1>
            <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">探索数据结构中的表格世界</p>
            <div class="flex justify-center space-x-4">
                <a href="#definition" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-indigo-50 transition-all">开始学习</a>
                <a href="#exercises" class="border-2 border-white text-white px-6 py-3 rounded-lg font-medium hover:bg-white hover:bg-opacity-10 transition-all">练习题目</a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 py-12">
        <!-- Overview Section -->
        <section id="overview" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-layer-group mr-3 text-indigo-500"></i>概述
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 md:p-8">
                    <p class="text-lg text-gray-700 mb-6">二维数组是一种特殊的数组，它由多个一维数组组成，每个一维数组又包含多个元素。可以将二维数组看作是一个表格或者矩阵，其中行和列分别对应数组的第一维和第二维。</p>
                    
                    <div class="my-8 flex justify-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1709693836193-b804ccf5-ec51-4a1a-b92e-ae66a1bfee85.png?x-oss-process=image%2Fformat%2Cwebp%2Fresize%2Cw_586%2Climit_0" 
                             alt="二维数组示意图" 
                             class="rounded-lg shadow-md border border-gray-200 max-w-full h-auto">
                    </div>
                    
                    <p class="text-lg text-gray-700">二维数组在Java中的声明和初始化方式类似于一维数组，但需要指定行数和列数。通过二维数组，我们可以更方便地表示和处理表格型数据，例如二维矩阵、游戏地图等。</p>
                </div>
            </div>
        </section>

        <!-- Definition Section -->
        <section id="definition" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-code mr-3 text-indigo-500"></i>定义和初始化
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 md:p-8">
                    <p class="text-lg text-gray-700 mb-6">二维数组是一种由多个一维数组组成的数据结构，每个一维数组称为行，而整个二维数组则被视为表格。在Java中，二维数组的声明和初始化方式灵活多样，可以根据需求选择适合的方法。</p>
                    
                    <div class="my-8 flex justify-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1711000903371-13f706eb-f999-4410-867a-c7bd9da150d0.png" 
                             alt="二维数组定义示意图" 
                             class="rounded-lg shadow-md border border-gray-200 max-w-full h-auto">
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">Java中定义二维数组的语法如下：</h3>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>dataType[][] arrayName = new dataType[rows][columns];</code></pre>
                    </div>
                    
                    <p class="text-gray-700 mb-6">其中，<code class="bg-gray-100 px-2 py-1 rounded">dataType</code> 表示数组元素的数据类型，<code class="bg-gray-100 px-2 py-1 rounded">arrayName</code> 是数组的名称，<code class="bg-gray-100 px-2 py-1 rounded">rows</code> 和 <code class="bg-gray-100 px-2 py-1 rounded">columns</code> 分别表示数组的行数和列数。</p>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">直接赋值初始化</h3>
                    <p class="text-gray-700 mb-4">可以直接赋值给二维数组的每个元素，如下所示：</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>int[][] matrix = {
    {1, 2, 3},
    {4, 5, 6},
    {7, 8, 9}
};</code></pre>
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">动态初始化</h3>
                    <p class="text-gray-700 mb-4">通过循环或其他逻辑来动态初始化二维数组，如下所示：</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>int[][] matrix = new int[3][3];
for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
        matrix[i][j] = i + j;
    }
}</code></pre>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-16">
            <h3 class="text-2xl font-semibold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-project-diagram mr-3 text-indigo-500"></i>二维数组可视化
            </h3>
            <div class="bg-white rounded-xl shadow-md overflow-hidden p-6">
                <div class="array-visualization grid grid-cols-3 gap-2 max-w-sm mx-auto mb-8">
                    <div class="array-cell font-mono">[0][0]</div>
                    <div class="array-cell font-mono">[0][1]</div>
                    <div class="array-cell font-mono">[0][2]</div>
                    <div class="array-cell font-mono">[1][0]</div>
                    <div class="array-cell font-mono highlight">[1][1]</div>
                    <div class="array-cell font-mono">[1][2]</div>
                    <div class="array-cell font-mono">[2][0]</div>
                    <div class="array-cell font-mono">[2][1]</div>
                    <div class="array-cell font-mono">[2][2]</div>
                </div>
                
                <div class="mermaid">
                    graph TD
                    A[二维数组] --> B[第一行]
                    A --> C[第二行]
                    A --> D[第三行]
                    B --> B1[元素1]
                    B --> B2[元素2]
                    B --> B3[元素3]
                    C --> C1[元素4]
                    C --> C2[元素5]
                    C --> C3[元素6]
                    D --> D1[元素7]
                    D --> D2[元素8]
                    D --> D3[元素9]
                </div>
            </div>
        </section>

        <!-- Access and Operations -->
        <section id="operations" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-cogs mr-3 text-indigo-500"></i>访问和操作
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 md:p-8">
                    <p class="text-lg text-gray-700 mb-6">二维数组的访问和操作包括获取元素值、修改元素值、遍历数组等操作。以下是二维数组的常见访问和操作方法。</p>
                    
                    <div class="my-8 flex justify-center">
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1711001012626-e7daed56-28df-40e0-9dd0-e01b11f0b553.png" 
                             alt="二维数组操作示意图" 
                             class="rounded-lg shadow-md border border-gray-200 max-w-full h-auto">
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">获取元素值</h3>
                    <p class="text-gray-700 mb-4">要获取二维数组中特定位置的元素值，可以通过索引进行访问，如 <code class="bg-gray-100 px-2 py-1 rounded">arrayName[rowIndex][colIndex]</code>，其中 <code class="bg-gray-100 px-2 py-1 rounded">rowIndex</code> 表示行索引，<code class="bg-gray-100 px-2 py-1 rounded">colIndex</code> 表示列索引。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>int[][] matrix = {
    {1, 2, 3},
    {4, 5, 6},
    {7, 8, 9}
};
int value = matrix[1][2]; // 获取第二行第三列的元素值，结果为6</code></pre>
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">修改元素值</h3>
                    <p class="text-gray-700 mb-4">要修改二维数组中特定位置的元素值，可以通过索引进行赋值操作，如 <code class="bg-gray-100 px-2 py-1 rounded">arrayName[rowIndex][colIndex] = newValue</code>。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>matrix[1][2] = 10; // 将第二行第三列的元素值修改为10</code></pre>
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">遍历数组</h3>
                    <p class="text-gray-700 mb-4">遍历二维数组可以使用嵌套循环，外层循环控制行数，内层循环控制列数，逐个访问数组中的元素。</p>
                    
                    <div class="code-block mb-6">
                        <button class="copy-btn" onclick="copyCode(this)">
                            <i class="far fa-copy"></i>
                        </button>
                        <pre class="text-gray-200"><code>for (int i = 0; i < matrix.length; i++) {
    for (int j = 0; j < matrix[i].length; j++) {
        System.out.print(matrix[i][j] + " ");
    }
    System.out.println(); // 换行
}</code></pre>
                    </div>
                    
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">其他操作</h3>
                    <p class="text-gray-700">除了上述常见操作外，还可以根据需求进行数组的拷贝、比较、转置等操作，具体实现方法可以根据实际情况选择适当的算法和数据结构。</p>
                </div>
            </div>
        </section>

        <!-- Examples Section -->
        <section id="examples" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-laptop-code mr-3 text-indigo-500"></i>示例代码
            </h2>
            
            <div class="grid md:grid-cols-2 gap-6">
                <!-- Example 1 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden concept-card">
                    <div class="p-6">
                        <h3 class="text-xl font-semibold mb-4 text-gray-800">打印二维数组</h3>
                        <div class="code-block mb-4">
                            <button class="copy-btn" onclick="copyCode(this)">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre class="text-gray-200"><code>public class Main {
    public static void main(String[] args) {
        int[][] matrix = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        };
        
        // 打印二维数组
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                System.out.print(matrix[i][j] + " ");
            }
            System.out.println(); // 换行
        }
    }
}</code></pre>
                        </div>
                        <div class="bg-gray-100 p-4 rounded-lg">
                            <p class="font-medium text-gray-800 mb-2">输出结果：</p>
                            <pre class="bg-white p-2 rounded text-gray-800"><code>1 2 3 
4 5 6 
7 8 9</code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- Example 2 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden concept-card">
                    <div class="p-6">
                        <h3 class="text-xl font-semibold mb-4 text-gray-800">计算二维数组中所有元素的和</h3>
                        <div class="code-block mb-4">
                            <button class="copy-btn" onclick="copyCode(this)">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre class="text-gray-200"><code>public class Main {
    public static void main(String[] args) {
        int[][] matrix = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        };
        
        // 计算二维数组中所有元素的和
        int sum = 0;
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                sum += matrix[i][j];
            }
        }
        System.out.println("二维数组所有元素的和为：" + sum);
    }
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <!-- Example 3 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden concept-card">
                    <div class="p-6">
                        <h3 class="text-xl font-semibold mb-4 text-gray-800">查找二维数组中的最大值</h3>
                        <div class="code-block mb-4">
                            <button class="copy-btn" onclick="copyCode(this)">
                                <i class="far fa-copy"></i>
                            </button>
                            <pre class="text-gray-200"><code>public class Main {
    public static void main(String[] args) {
        int[][] matrix = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        };
        
        // 查找二维数组中的最大值
        int max = matrix[0][0];
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                if (matrix[i][j] > max) {
                    max = matrix[i][j];
                }
            }
        }
        System.out.println("二维数组中的最大值为：" + max);
    }
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Issues and Notes -->
        <section id="issues" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-exclamation-triangle mr-3 text-indigo-500"></i>常见问题和注意事项
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 md:p-8">
                    <h3 class="text-xl font-semibold mb-4 text-gray-800">常见问题</h3>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-5 w-5 text-red-500 mt-1">
                                <i class="fas fa-bug"></i>
                            </div>
                            <p class="ml-3 text-gray-700"><span class="font-medium">数组越界：</span> 在访问二维数组元素时，需注意边界情况，避免出现数组越界异常。</p>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-5 w-5 text-red-500 mt-1">
                                <i class="fas fa-bug"></i>
                            </div>
                            <p class="ml-3 text-gray-700"><span class="font-medium">数组初始化：</span> 确保二维数组的每个子数组长度一致，避免在初始化时出现不规范的情况。</p>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-5 w-5 text-red-500 mt-1">
                                <i class="fas fa-bug"></i>
                            </div>
                            <p class="ml-3 text-gray-700"><span class="font-medium">数组遍历：</span> 在遍历二维数组时，需嵌套使用循环来访问每个元素，注意循环变量的范围和顺序。</p>
                        </div>
                        <div class="flex items-start">
                            <div class="flex-shrink-0 h-5 w-5 text-red-500 mt-1">
                                <i class="fas fa-bug"></i>
                            </div>
                            <p class="ml-3 text-gray-700"><span class="font-medium">数组操作：</span> 对二维数组进行操作时，需谨慎处理索引和元素值，确保操作的准确性和安全性。</p>
                        </div>
                    </div>
                    
                    <h3 class="text-xl font-semibold mt-8 mb-4 text-gray-800">注意事项</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div class="bg-indigo-50 p-4 rounded-lg">
                            <h4 class="font-medium text-indigo-700 mb-2 flex items-center">
                                <i class="fas fa-memory mr-2"></i>内存消耗
                            </h4>
                            <p class="text-gray-700">二维数组占用的内存空间较大，特别是在处理大规模数据时，需注意内存消耗情况。</p>
                        </div>
                        <div class="bg-indigo-50 p-4 rounded-lg">
                            <h4 class="font-medium text-indigo-700 mb-2 flex items-center">
                                <i class="fas fa-tachometer-alt mr-2"></i>性能优化
                            </h4>
                            <p class="text-gray-700">对二维数组的操作应尽量避免不必要的复杂度，优化算法和数据结构，提高程序执行效率。</p>
                        </div>
                        <div class="bg-indigo-50 p-4 rounded-lg">
                            <h4 class="font-medium text-indigo-700 mb-2 flex items-center">
                                <i class="fas fa-code mr-2"></i>代码规范
                            </h4>
                            <p class="text-gray-700">编写二维数组相关代码时，应遵循统一的编码规范和风格，提高代码的可读性和可维护性。</p>
                        </div>
                        <div class="bg-indigo-50 p-4 rounded-lg">
                            <h4 class="font-medium text-indigo-700 mb-2 flex items-center">
                                <i class="fas fa-shield-alt mr-2"></i>异常处理
                            </h4>
                            <p class="text-gray-700">在处理二维数组时，需注意异常情况的处理，避免程序运行出现意外错误。</p>
                        </div>
                    </div>
                    
                    <p class="mt-6 text-gray-700">以上问题和注意事项可以帮助学生更好地理解和应用二维数组，提高代码的质量和性能。</p>
                </div>
            </div>
        </section>

        <!-- Extensions -->
        <section id="extensions" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-plus-circle mr-3 text-indigo-500"></i>扩展知识
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 md:p-8">
                    <div class="grid md:grid-cols-2 gap-6">
                        <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-all">
                            <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                                <i class="fas fa-cubes mr-2 text-indigo-500"></i>多维数组
                            </h3>
                            <p class="text-gray-700">除了二维数组外，还有更高维度的多维数组，可以进一步学习如何定义、初始化和操作多维数组。</p>
                        </div>
                        <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-all">
                            <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                                <i class="fas fa-network-wired mr-2 text-indigo-500"></i>数组与集合
                            </h3>
                            <p class="text-gray-700">深入了解数组与其他数据结构的区别，以及在不同场景下的应用和选择。</p>
                        </div>
                        <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-all">
                            <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                                <i class="fas fa-sitemap mr-2 text-indigo-500"></i>算法与数据结构
                            </h3>
                            <p class="text-gray-700">学习常用的算法和数据结构，如排序、查找、栈、队列等，掌握它们的原理和实现方式。</p>
                        </div>
                        <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-all">
                            <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                                <i class="fas fa-expand mr-2 text-indigo-500"></i>动态数组
                            </h3>
                            <p class="text-gray-700">学习动态数组的概念和实现原理，了解其在内存管理和性能优化方面的优势。</p>
                        </div>
                        <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-all md:col-span-2">
                            <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                                <i class="fas fa-th-large mr-2 text-indigo-500"></i>多维数组应用
                            </h3>
                            <p class="text-gray-700">深入探讨多维数组在实际应用中的场景和用法，如图像处理、矩阵运算等。</p>
                        </div>
                    </div>
                    
                    <p class="mt-6 text-gray-700">通过进一步学习和实践，学生可以更全面地掌握数组相关知识，并且能够灵活运用在实际的编程项目中。</p>
                </div>
            </div>
        </section>

        <!-- Exercises -->
        <section id="exercises" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 flex items-center">
                <i class="fas fa-tasks mr-3 text-indigo-500"></i>练习题
            </h2>
            
            <div class="space-y-6">
                <!-- Exercise 1 -->
                <div class="exercise bg-white p-6 rounded-lg shadow-sm">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 bg-indigo-100 text-indigo-600 rounded-full h-8 w-8 flex items-center justify-center mr-4">
                            <span class="font-bold">1</span>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3 text-gray-800">打印行列总和</h3>
                            <p class="text-gray-700 mb-4">编写一个Java程序，创建一个3x3的二维数组，并初始化为如下值：</p>
                            <div class="bg-gray-100 p-4 rounded-lg mb-4">
                                <pre class="text-gray-800"><code>1 2 3
4 5 6
7 8 9</code></pre>
                            </div>
                            <p class="text-gray-700">然后计算并输出该数组的每一行和每一列的总和。</p>
                        </div>
                    </div>
                </div>
                
                <!-- Exercise 2 -->
                <div class="exercise bg-white p-6 rounded-lg shadow-sm">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 bg-indigo-100 text-indigo-600 rounded-full h-8 w-8 flex items-center justify-center mr-4">
                            <span class="font-bold">2</span>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3 text-gray-800">非零元素求和</h3>
                            <p class="text-gray-700 mb-4">编写一个Java程序，创建一个5x5的二维数组，要求按如下方式初始化数组：</p>
                            <div class="bg-gray-100 p-4 rounded-lg mb-4">
                                <pre class="text-gray-800"><code>1 0 0 0 0
0 2 0 0 0
0 0 3 0 0
0 0 0 4 0
0 0 0 0 5</code></pre>
                            </div>
                            <p class="text-gray-700">然后输出数组中所有非零元素的和。</p>
                        </div>
                    </div>
                </div>
                
                <!-- Exercise 3 -->
                <div class="exercise bg-white p-6 rounded-lg shadow-sm">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 bg-indigo-100 text-indigo-600 rounded-full h-8 w-8 flex items-center justify-center mr-4">
                            <span class="font-bold">3</span>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3 text-gray-800">对角线元素求和</h3>
                            <p class="text-gray-700 mb-4">编写一个Java程序，创建一个4x4的二维数组，要求按如下方式初始化数组：</p>
                            <div class="bg-gray-100 p-4 rounded-lg mb-4">
                                <pre class="text-gray-800"><code>1 0 0 0
2 3 0 0
4 5 6 0
7 8 9 10</code></pre>
                            </div>
                            <p class="text-gray-700">然后输出数组中的对角线元素之和。</p>
                        </div>
                    </div>
                </div>
                
                <!-- Exercise 4 -->
                <div class="exercise bg-white p-6 rounded-lg shadow-sm">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 bg-indigo-100 text-indigo-600 rounded-full h-8 w-8 flex items-center justify-center mr-4">
                            <span class="font-bold">4</span>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3 text-gray-800">统计1的个数</h3>
                            <p class="text-gray-700 mb-4">编写一个Java程序，创建一个3x3的二维数组，并随机初始化数组元素为0或1。</p>
                            <p class="text-gray-700">然后统计数组中1的个数，并输出结果。</p>
                        </div>
                    </div>
                </div>
                
                <!-- Exercise 5 -->
                <div class="exercise bg-white p-6 rounded-lg shadow-sm">
                    <div class="flex items-start">
                        <div class="flex-shrink-0 bg-indigo-100 text-indigo-600 rounded-full h-8 w-8 flex items-center justify-center mr-4">
                            <span class="font-bold">5</span>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-3 text-gray-800">查找最大值位置</h3>
                            <p class="text-gray-700 mb-4">编写一个Java程序，创建一个5x5的二维数组，并随机初始化数组元素为1至100之间的随机数。</p>
                            <p class="text-gray-700">然后找出数组中的最大值及其所在位置，并输出结果。</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="footer text-white py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400">探索编程的无限可能</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition-colors">
                        <i class="fas fa-link mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Copy code function
        function copyCode(button) {
            const codeBlock = button.nextElementSibling;
            const range = document.createRange();
            range.selectNode(codeBlock);
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand('copy');
            window.getSelection().removeAllRanges();
            
            // Change icon temporarily to indicate success
            const icon = button.querySelector('i');
            const originalClass = icon.className;
            icon.className = 'fas fa-check';
            
            setTimeout(() => {
                icon.className = originalClass;
            }, 1000);
        }
        
        // Add animation to hero section on scroll
        document.addEventListener('DOMContentLoaded', function() {
            const hero = document.querySelector('.hero');
            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('animate-fade-in');
                    }
                });
            }, { threshold: 0.1 });
            
            observer.observe(hero);
        });
    </script>
</body>
</html>
```